
module.exports = function ($scope, $state, $stateParams,$resource,$modal,items,$modalInstance,FileUploader) {
    console.log(items);
    $scope.a=items;
    $scope.info={'photo':''};
    $scope.applyarr=[
        {name:'区县项目',value:'0'},
        {name:'市级项目',value:'1'},
    ]
    // 责任处室
    $scope.officeFileArr = [
      {name:'规划发展处',value:'3', id : ['8', '9']},
      {name:'行业管理处  ',value:'6', id : ['3', '4']},
      {name:'人事编制处 ',value:'1', id : ['1', '2']},
      {name:'政策法规处 ',value:'2', id : ['3', '4']},
      {name:'区域合作处',value:'4', id : ['5', '6', '7']},
      {name:'市场开发处 ',value:'5', id : ['1', '2']},
      {name:'产业发展处',value:'7', id : ['8', '9']},
      {name:'特色旅游处',value:'8', id : ['5', '6', '7']},
      {name:'旅游质量监督管理所',value:'9', id : ['3', '4']},
      {name:'旅游产业发展服务中心',value:'10', id : ['8', '9']},
      {name:'机关党委',value:'11', id : ['5', '6', '7']},
      {name:'办公室',value:'12', id : ['5', '6', '7']}
  ]
    $scope.officeFileArr.forEach(element => {
        if($scope.a.recommend_type === element.value){
            $scope.a.recommend_type = element.name;
        }
    });

    $scope.array = $scope.a.guide_pdf.split(',');
    console.log($scope.array);
    for(var i = 0;i<$scope.array.length;i++){
        if($scope.array[i]==''){
            $scope.array.splice(i,1);
        }
    }    
$scope.submit = function(){

    var para = {  
        guide_name:$scope.name,   
        guide_type:$scope.guide_type
     }

     console.log(para);
     $resource('/api/as/goc/reviewGuide/create', {}, {}).save(para, function(res){
            // console.log(res);
            if(res.errcode === 0){                      
                alert('提交成功');  
                 $modalInstance.close();
            }else{
                alert(res.errmsg);
            }
        });
}
			


};
